<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手写Promise-利用class的方式实现Promise-catch方法</title>
    <script src="./index.js"></script>
</head>

<body>
    <script>
        const p1 = new Promise((resolve, reject) => {
            reject(1);
        })
        const p2 = p1.catch(reason => {
            throw '异常'
        })
        console.log(p2);
    </script>
</body>

</html>